package com.example.demo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Objects;

/**
 * 功能描述：
 *
 * @Author: Zhanghf
 * @Date: 2021/12/11 12:03
 */
public class BookShelf {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer userid;
    private Integer bookid;

    public BookShelf(Integer userid, Integer bookid) {
        this.userid = userid;
        this.bookid = bookid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BookShelf)) return false;
        BookShelf bookShelf = (BookShelf) o;
        return Objects.equals(userid, bookShelf.userid) &&
                Objects.equals(bookid, bookShelf.bookid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userid, bookid);
    }

    @Override
    public String toString() {
        return "BookShelf{" +
                "id=" + id +
                ", userid=" + userid +
                ", bookid=" + bookid +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public Integer getBookid() {
        return bookid;
    }

    public void setBookid(Integer bookid) {
        this.bookid = bookid;
    }

    public BookShelf() {
    }
}
